CREATE OR REPLACE PACKAGE Absence_Action_API IS

module_  CONSTANT VARCHAR2(25) := 'WRKSCH';
lu_name_ CONSTANT VARCHAR2(25) := 'AbsenceAction';
lu_type_ CONSTANT VARCHAR2(25) := 'Entity';

-----------------------------------------------------------------------------
-------------------- PUBLIC DECLARATIONS ------------------------------------
-----------------------------------------------------------------------------

TYPE Public_Rec IS RECORD
  (company_id                     ABSENCE_ACTION_TAB.company_id%TYPE,
   action_id                      ABSENCE_ACTION_TAB.action_id%TYPE,
   "rowid"                        rowid,
   rowversion                     ABSENCE_ACTION_TAB.rowversion%TYPE,
   rowkey                         ABSENCE_ACTION_TAB.rowkey%TYPE,
   action_description             ABSENCE_ACTION_TAB.action_description%TYPE,
   remarks                        ABSENCE_ACTION_TAB.remarks%TYPE);


-----------------------------------------------------------------------------
-------------------- BASE METHODS -------------------------------------------
-----------------------------------------------------------------------------
-- Get_Key_By_Rowkey
--   Returns a table record with only keys (other attributes are NULL) based on a rowkey.
--
-- Exist
--   Checks if given pointer (e.g. primary key) to an instance of this
--   logical unit exists. If not an exception will be raised.
--
-- Exists
--   Same check as Exist, but returns a BOOLEAN value instead of exception.
--
-- Get_Action_Description
--   Fetches the ActionDescription attribute for a record.
--
-- Get_Remarks
--   Fetches the Remarks attribute for a record.
--
-- Get
--   Fetches a record containing the public attributes.
--
-- Get_Objkey
--   Fetches the objkey attribute for a record.
--
-- Lock__
--   Client-support to lock a specific instance of the logical unit.
--
-- New__
--   Client-support interface to create LU instances.
--   action_ = 'PREPARE'
--   Default values and handle of information to client.
--   The default values are set in procedure Prepare_Insert___.
--   action_ = 'CHECK'
--   Check all attributes before creating new object and handle of
--   information to client. The attribute list is unpacked, checked
--   and prepared (defaults) in procedures Unpack___ and Check_Insert___.
--   action_ = 'DO'
--   Creation of new instances of the logical unit and handle of
--   information to client. The attribute list is unpacked, checked
--   and prepared (defaults) in procedures Unpack___ and Check_Insert___
--   before calling procedure Insert___.
--
-- Modify__
--   Client-support interface to modify attributes for LU instances.
--   action_ = 'CHECK'
--   Check all attributes before modifying an existing object and
--   handle of information to client. The attribute list is unpacked,
--   checked and prepared(defaults) in procedures Unpack___ and Check_Update___.
--   action_ = 'DO'
--   Modification of an existing instance of the logical unit. The
--   procedure unpacks the attributes, checks all values before
--   procedure Update___ is called.
--
-- Remove__
--   Client-support interface to remove LU instances.
--   action_ = 'CHECK'
--   Check whether a specific LU-instance may be removed or not.
--   The procedure fetches the complete record by calling procedure
--   Get_Object_By_Id___. Then the check is made by calling procedure
-----------------------------------------------------------------------------

--@PoReadOnly(Get_Key_By_Rowkey)
FUNCTION Get_Key_By_Rowkey (
   rowkey_ IN VARCHAR2 ) RETURN absence_action_tab%ROWTYPE;

--@PoReadOnly(Exist)
PROCEDURE Exist (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 );

--@PoReadOnly(Exists)
FUNCTION Exists (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 ) RETURN BOOLEAN;

--@PoReadOnly(Get_Action_Description)
FUNCTION Get_Action_Description (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 ) RETURN VARCHAR2;

--@PoReadOnly(Get_Remarks)
FUNCTION Get_Remarks (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 ) RETURN VARCHAR2;

--@PoReadOnly(Get)
FUNCTION Get (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 ) RETURN Public_Rec;

--@PoReadOnly(Get_Objkey)
FUNCTION Get_Objkey (
   company_id_ IN VARCHAR2,
   action_id_ IN VARCHAR2 ) RETURN VARCHAR2;

--@PoReadOnly(Lock__)
PROCEDURE Lock__ (
   info_       OUT VARCHAR2,
   objid_      IN  VARCHAR2,
   objversion_ IN  VARCHAR2 );

PROCEDURE New__ (
   info_       OUT    VARCHAR2,
   objid_      OUT    VARCHAR2,
   objversion_ OUT    VARCHAR2,
   attr_       IN OUT NOCOPY VARCHAR2,
   action_     IN     VARCHAR2 );

PROCEDURE Modify__ (
   info_       OUT    VARCHAR2,
   objid_      IN     VARCHAR2,
   objversion_ IN OUT NOCOPY VARCHAR2,
   attr_       IN OUT NOCOPY VARCHAR2,
   action_     IN     VARCHAR2 );

PROCEDURE Remove__ (
   info_       OUT VARCHAR2,
   objid_      IN  VARCHAR2,
   objversion_ IN  VARCHAR2,
   action_     IN  VARCHAR2 );

-----------------------------------------------------------------------------
-------------------- COMPANY SPECIFIC METHODS -------------------------------
-----------------------------------------------------------------------------
-- Make_Company
--   Manages export, import and copy of company related data.
--
-- Create_Company_Reg__
--   Creates a registration entity into the company copy framework.
--
-- Create_Client_Mapping__
--   Creates a client mapping entity into the company copy framework.
-----------------------------------------------------------------------------

PROCEDURE Make_Company (
   attr_ IN VARCHAR2 );

PROCEDURE Create_Company_Reg__ (
   execution_order_   IN OUT NOCOPY NUMBER,
   create_and_export_ IN     BOOLEAN  DEFAULT TRUE,
   active_            IN     BOOLEAN  DEFAULT TRUE,
   account_related_   IN     BOOLEAN  DEFAULT FALSE,
   standard_table_    IN     BOOLEAN  DEFAULT TRUE );

PROCEDURE Create_Client_Mapping__ (
   client_window_ IN VARCHAR2 DEFAULT 'frmCreateCompanyTemDetail' );

-----------------------------------------------------------------------------
-------------------- FOUNDATION1 METHODS ------------------------------------
-----------------------------------------------------------------------------
-- Init
--   Framework method that initializes this package.
-----------------------------------------------------------------------------

--@PoReadOnly(Init)
PROCEDURE Init;

END Absence_Action_API;
